/*
 * 项目基础类
 * @author: huangzong
 */
const C = require('../common/common.js')

class Goods {
    constructor () {
    }

    /*
   * 打开基础设置页面
   */
    async openEditGoods (row) {
        return await C.openBrowserWindow('/editGoods', row, {
            transparent: true,
            frame: false,
            // openDevTools: true,
            width: 600,
            height: 319,
            useSpa: true,
            spaModel: 'shop'
        })
    }

    /*
   * 编辑产品
   */
    async editGoods (data) {
        return await C.ajax('/shop/goods/editgoods', data, 'post')
    }

    /*
   * 新增自营商品
   */
    async openAddShopGoods (row) {
        return await C.openBrowserWindow('/openAddShopGoods', row, {
            transparent: true,
            frame: false,
            // openDevTools: true,
            width: 500,
            height: 645,
            useSpa: true,
            spaModel: 'shop'
        })
    }

    /*
   * 打开产品分类
   */
    async openGoodsCategoryList (row) {
        return await C.openBrowserWindow('/openGoodsCategoryList', row, {
            transparent: true,
            frame: false,
            // openDevTools: true,
            width: 500,
            height: 645,
            useSpa: true,
            spaModel: 'shop'
        })
    }

    /*
   * 打开品牌分类
   */
    async openBrandList (row) {
        return await C.openBrowserWindow('/openBrandList', row, {
            transparent: true,
            frame: false,
            // openDevTools: true,
            width: 800,
            height: 645,
            useSpa: true,
            spaModel: 'shop'
        })
    }
}

module.exports = new Goods()